From c7e7e350839b19732a2eea7a2151c0c3a76c2544 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Thu, 13 Nov 2014 03:58:32 +0100 Subject: [PATCH] mir: don't request more surface formats than the supported ones --- gdk/mir/gdkmirwindowimpl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdk/mir/gdkmirwindowimpl.c b/gdk/mir/gdkmirwindowimpl.c index 526e7d4b55..4f9f9d3f8c 100644 --- a/gdk/mir/gdkmirwindowimpl.c +++ b/gdk/mir/gdkmirwindowimpl.c @@ -154,7 +154,7 @@ static void ensure_surface (GdkWindow *window) { GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl); - MirPixelFormat formats[100], pixel_format = mir_pixel_format_invalid; + MirPixelFormat formats[mir_pixel_formats], pixel_format = mir_pixel_format_invalid; unsigned int n_formats, i; MirSurfaceParameters parameters; MirEventDelegate event_delegate = { event_cb, NULL }; @@ -172,7 +172,7 @@ ensure_surface (GdkWindow *window) // Should probably calculate this once? // Should prefer certain formats over others - mir_connection_get_available_surface_formats (get_connection (window), formats, 100, &n_formats); + mir_connection_get_available_surface_formats (get_connection (window), formats, mir_pixel_formats, &n_formats); for (i = 0; i < n_formats; i++) if (formats[i] == mir_pixel_format_argb_8888) { -- 2.30.2